<script setup lang="ts">
import { reactive } from "vue";

// reactive 函数
const obj = reactive({
  name: 'Joker',
  age: 18
})

const oneYear = () => {
  obj.age++
}
</script>

<template>
  <div class="app-page">
    <div>姓名：{{ obj.name }}, 年龄：{{ obj.age }}</div>
    <button @click="oneYear">过了一年</button>
  </div>
</template>

<style lang="css" scoped></style>